package marina;

import java.util.Scanner;

public class Ch02Ex03 {
	public static void main(String[] args) {
		int money;
		int oman;
		int man;
		int chun;
		int obek;
		int bek;
		int osib;
		int sib;
		int il;
		Scanner a = null;

		a = new Scanner(System.in);
		System.out.println("돈의 액수를 입력하세요.");
		money = a.nextInt();

		if (money >= 50000) {
			oman = money / 50000;
			money = money % 50000;
		} else {
			oman = 0;
		}
		if (money >= 10000) {
			man = money / 10000;
			money = money % 10000;
		} else {
			man = 0;
		}
		if (money >= 1000) {
			chun = money / 1000;
			money = money % 1000;
		} else {
			chun = 0;
		}
		if (money >= 500) {
			obek = money / 500;
			money = money % 500;
		} else {
			obek = 0;
		}
		if (money >= 100) {
			bek = money / 100;
			money = money % 100;
		} else {
			bek = 0;
		}
		if (money >= 50) {
			osib = money / 50;
			money = money % 50;
		} else {
			osib = 0;
		}
		if (money >= 10) {
			sib = money / 10;
			money = money % 10;
		} else {
			sib = 0;
		}
		il = money;

		System.out.println(
				"오만원권"+oman+"매, "+"만원권"+man+"매, "+"천원권"+chun+"매, "+
				"오백원짜리"+obek+"개, "+"백원짜리"+bek+"개, "+"오십원짜리"+osib+"개, "+
				"십원짜리"+sib+"개, "+"일원짜리"+il+"개, "
		);
	}
}
